package com.example.demo.repository;

import com.example.demo.entity.OrderBase;
import com.example.demo.entity.OrderImg;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;

import javax.transaction.Transactional;

public interface OrderImgRepository extends JpaRepository<OrderImg,Integer>,JpaSpecificationExecutor<OrderImg> {

    @Modifying
    @Transactional
    @Query(value = "delete from OrderImg a where a.orderBase = ?1")
    void deleteByOrderId(OrderBase OrderId);


}
